@extends('layouts.master')

@section('title')
    下单——钢链网管理后台
@stop

@section('app_css')
    <link rel="stylesheet" href="/resource/css/bootstrap.min.css">
    <link rel="stylesheet" href="/resource/css/font-awesome.min.css">
    <link rel="stylesheet" href="/resource/css/animate.min.css">
    <link rel="stylesheet" href="/resource/css/custom.css">
    <link rel="stylesheet" href="/resource/css/green.css">
    <link rel="stylesheet" href="/resource/css/fileinput.min.css">
    <style>
        .form-group-no{
            overflow: inherit;
        }
        .mobile{
            display: none;
            position: absolute;
            left:10px;
            top:34px;
            z-index: 3;
            width: 80%;
            height:200px;
            background:#fff;
            border:1px solid #ccc;
            padding:10px;
            list-style: none;
            overflow: hidden;
        }
        .mobile li{
            padding-left:20px;
            line-height:30px;
            cursor: pointer;
        }
        .mobile li:hover,.mobile li.active{
            background:#f1f1f1;
        }
    </style>
@stop

@section('app_js')
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="/resource/js/jquery.min.js"></script>
    <script src="/resource/js/bootstrap.min.js"></script>
    <script src="/resource/js/custom.js"></script>
    <!-- icheck -->
    <script src="/resource/js/icheck.min.js"></script>
    <!-- Datatables -->
    <script src="/resource/js/jquery.dataTables.js"></script>
    <script src="/resource/js/J_main.js"></script>
    <!-- 添加图片 -->
    <script src="/resource/js/fileinput.min.js"></script>
    <script src="/resource/js/fileinput_locale_zh.js"></script>
    <script>
        $(function(){
            var str = "<ul class=\"mobile\"></ul>";
            var strid = "<div id='user_id'></div>";
            $("#mobile").after(str);
            $('.form-group-no').after(strid);
            $(document).delegate('#mobile','keyup',function(event) {
                $('.mobile').show();
                var mobile = $(this).val();
                var strli = "";
                $.ajax({
                    url: "/admin/select_user_mobile",
                    type: "get",
                    data: "key_word="+mobile,
                    async:false,
                    success: function (msg) {
                        console.log(msg);
                        $.each(msg,function(index,arr){
                            strli += "<li rel="+ arr.user_id +">";
                            strli += arr.mobile;
                            strli += " (";
                            strli += arr.user_name;
                            strli += ")</li>";
                        });
                    }
                });
                $('.mobile').html(strli);
                $('.mobile li').eq(0).addClass('active');
            });
            $(document).delegate('.mobile li','click',function() {
                $("#mobile").val($(this).html());
                $('.mobile').hide();
                $('#user_id').html("<input type='hidden' name='user_id' value="+$(this).attr('rel')+">");
            });
        });
    </script>
@stop

@section('content')
    <body class="nav-md">

    <div class="container body">


        <div class="main_container">

            @include('common.admin_menu')

            <!-- top navigation -->
            @include('common.admin_nav')
            <!-- /top navigation -->


            <!-- page content -->
            <div class="right_col" role="main">

                <div class="">

                    <div class="row cont">

                        <div class="col-md-6 col-sm-12 col-xs-12">
                            <div class="x_panel">
                                <div class="x_title">
                                    <h2>下单 <small>订单管理</small></h2>
                                    <div class="clearfix"></div>
                                </div>

                                <div class="x_content">
                                    <br />
                                        {{ Form::open(['url'=>'/admin/down_order_import_action', 'id'=>'demo-form2', 'class'=> 'form-horizontal form-label-left', 'files' => true, 'method' => 'post']) }}
                                    <input type="hidden" name="product_id" value="{{$product_id}}"/>
                                    <div class="form-group form-group-no">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-12" for="first-name">电话(下单用户)
                                        </label>
                                        <div class="col-md-10 col-sm-10 col-xs-12">
                                            <input name="mobile" autocomplete="off" type="text" id="mobile" required="required" class="form-control col-md-7 col-xs-12" >
                                        </div>
                                    </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="first-name">件数
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input name="number" type="text" id="first-name" required="required" class="form-control col-md-7 col-xs-12" >
                                            </div>
                                        </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-12" for="first-name">支付方式
                                        </label>
                                        <div class="col-md-10 col-sm-10 col-xs-12">
                                            <select name="pay" class="form-control col-md-7 col-xs-12" >
                                                @foreach(PaymentEnum::$payment as $k=>$v)
                                                <option value="{{$k}}">{{$v}}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                    </div>

                                        <div class="ln_solid"></div>
                                        <div class="form-group">
                                            <div class="col-md-10 col-sm-10 col-xs-12 col-md-offset-3">
                                                <button type="reset" class="btn btn-primary">取消</button>
                                                <button type="submit" class="btn btn-success">提交</button>
                                            </div>
                                        </div>

                                        {{ Form::close() }}
                                </div>
                            </div>
                        </div>

                        <br />
                        <br />
                        <br />

                    </div>
                </div>

                <!-- footer content -->

                <footer>
                    <div class="">
                        <p class="pull-right">Copyright 2016 mutouw.com All rights reserved. |
                            <span class="lead"> <i class="fa fa-logo-footer"></i> 木投网后台管理系统</span>
                        </p>
                    </div>
                    <div class="clearfix"></div>
                </footer>
                <!-- /footer content -->
            </div>
            <!-- /page content -->

        </div>
    </div>

    <div id="custom_notifications" class="custom-notifications dsp_none">
        <ul class="list-unstyled notifications clearfix" data-tabbed_notifications="notif-group">
        </ul>
        <div class="clearfix"></div>
        <div id="notif-group" class="tabbed_notifications"></div>
    </div>
    </body>
@stop